function throttle(fn, remain = 1000) {
  let flag = false
  return function () {
    if (!flag) {
      const args = arguments
      fn.call(this, ...args)
      flag = true
      settimeout(() => {
        flag=false
      }, remian)
    }
  }
}
